import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import format from 'date-fns/format'
//引入Buefy
import Buefy from 'buefy'
import 'buefy/dist/buefy.css'
//引入Element
import Element from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
//引入全局的css
import '@/assets/app.css'

import '@/permission'

import relativeTime from 'dayjs/plugin/relativeTime'
// 国际化
import 'dayjs/locale/zh-cn'
const dayjs = require('dayjs');

//引入vditor
import Vditor from "vditor"
import "vditor/dist/index.css"

//引入CKEditor
import CKEditor from 'ckeditor4-vue';
Vue.use( CKEditor );

// 相对时间插件
dayjs.extend(relativeTime)

dayjs.locale('zh-cn') // use locale globally
dayjs().locale('zh-cn').format() // use locale in a specific instance

Vue.prototype.dayjs = dayjs;//可以全局使用dayjs

Vue.filter('date' , (date) => {
  return format(new Date(date),'yyyy-MM-dd')
})

Vue.use(Buefy)
Vue.use(Element)

Vue.config.productionTip = false

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
